<?php
namespace sm_shop\model;
use sm_shop\model;
class cashLogModel extends model
{

    public static $status_text = [
        '1'=>'待核销',
        '2'=>'已核销',
        '3'=>'以拒绝',
    ];
    public static function todayLog( $customer_id ){

        $today = date('Y-m-d');
        $sql = 'select * from sh_cash_log '
            . ' where customer_id=' . $customer_id
            . ' and created_at like "%'. $today.'%"'
        ;
        return pdo_fetch( $sql );
    }

    public static function log( $customer_id, $filter = [] ){

        global $_W;

        $condition = [
            'uniacid'       => $_W['uniacid'],
            'customer_id'   => $customer_id
        ];
        $orderby = 'created_at desc';
        return sm_pdo_getall('cash_log', $condition,[],'', $orderby );

    }

}